<template>
	<view class="px-2">
		<scroll-view scroll-y="true" :style="{height:scrollH+'px'}">
			<block v-for="(item,index) in 20" :key="index">
				<user-item></user-item>
			</block>
		</scroll-view>
		<uni-popup type="top" ref="popupRef">
			<view class="py-2 border-bottom bg-white flex justify-center" hover-class="bg-hover-light">
				<text class="iconfont icon-sousuo"></text>
				<text class="ml-2">添加好友</text>
			</view>
			<view class="py-2 border-bottom bg-white flex justify-center" hover-class="bg-hover-light">
				<text class="iconfont icon-qingchu"></text>
				<text class="ml-2">清除缓存</text>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import uniPopup from '@/components/uni-ui/uni-popup/uni-popup.vue'
	export default {
		components: {
			uniPopup
		},
		data() {
			return {
				scrollH: 600
			};
		},
		onLoad() {
			uni.getSystemInfo({
				success: (res) => {
					this.scrollH = res.windowHeight - res.statusBarHeight;
				}
			})
		},
		onNavigationBarButtonTap(e) {
			switch (e.index) {
				case 0:
					uni.navigateTo({
						url: '/pages/user-list/user-list'
					})
					break;
				case 1:
					this.$refs.popupRef.open()
					break;
				default:
					break;
			}
		}
	}
</script>

<style lang="scss">

</style>